const { Sequelize } = require("sequelize");

const {
  MYSQL_HOST,
  MYSQL_PORT,
  MYSQL_USER,
  MYSQL_PWD,
  MYSQL_DB,
} = require("../config/config.default");
console.log(MYSQL_DB);
const seq = new Sequelize(MYSQL_DB, MYSQL_USER, MYSQL_PWD, {
  host: MYSQL_HOST,
  dialect: "mysql",
  force: true,
  charset: "utf8",
  collate: "utf8_general_ci",
  //禁止在控制台显示查询信息
  logging:false,
  /*schema:"en" ,
  schemaDelimiter:"_" */
});

/* seq
  .authenticate()
  .then(() => {
    console.log("数据库连接成功");
  })
  .catch((err) => {
    console.log("数据库连接失败", err);
  }); C55398   53*/
//seq.sync({ force: true });
module.exports = seq;
